3.1.25 \(\int \sqrt {a+b \cot ^2(x)} \tan ^4(x) \, dx\) [25]

Optimal. Leaf size=85 \[ -\sqrt {a-b} \text {ArcTan}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )-\frac {(3 a-b) \sqrt {a+b \cot ^2(x)} \tan (x)}{3 a}+\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x) \]

[Out]

-arctan(cot(x)*(a-b)^(1/2)/(a+b*cot(x)^2)^(1/2))*(a-b)^(1/2)-1/3*(3*a-b)*(a+b*cot(x)^2)^(1/2)*tan(x)/a+1/3*(a+
b*cot(x)^2)^(1/2)*tan(x)^3

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.353, Rules used = {3751, 486, 597, 12, 385, 209} \begin {gather*} -\sqrt {a-b} \text {ArcTan}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )+\frac {1}{3} \tan ^3(x) \sqrt {a+b \cot ^2(x)}-\frac {(3 a-b) \tan (x) \sqrt {a+b \cot ^2(x)}}{3 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + b*Cot[x]^2]*Tan[x]^4,x]

[Out]

-(Sqrt[a - b]*ArcTan[(Sqrt[a - b]*Cot[x])/Sqrt[a + b*Cot[x]^2]]) - ((3*a - b)*Sqrt[a + b*Cot[x]^2]*Tan[x])/(3*
a) + (Sqrt[a + b*Cot[x]^2]*Tan[x]^3)/3

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 486

Int[((e_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(e*x)^(m
+ 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^q/(a*e*(m + 1))), x] - Dist[1/(a*e^n*(m + 1)), Int[(e*x)^(m + n)*(a + b*
x^n)^p*(c + d*x^n)^(q - 1)*Simp[c*b*(m + 1) + n*(b*c*(p + 1) + a*d*q) + d*(b*(m + 1) + b*n*(p + q + 1))*x^n, x
], x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[0, q, 1] && LtQ[m, -1] &&
IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 597

Int[((g_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.)*((e_) + (f_.)*(x_)^(n_)),
x_Symbol] :> Simp[e*(g*x)^(m + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(a*c*g*(m + 1))), x] + Dist[1/(a*c*
g^n*(m + 1)), Int[(g*x)^(m + n)*(a + b*x^n)^p*(c + d*x^n)^q*Simp[a*f*c*(m + 1) - e*(b*c + a*d)*(m + n + 1) - e
*n*(b*c*p + a*d*q) - b*e*d*(m + n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, p, q}, x] &&
 IGtQ[n, 0] && LtQ[m, -1]

Rule 3751

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff/f), Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2
 + ff^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \sqrt {a+b \cot ^2(x)} \tan ^4(x) \, dx &=-\text {Subst}\left (\int \frac {\sqrt {a+b x^2}}{x^4 \left (1+x^2\right )} \, dx,x,\cot (x)\right )\\ &=\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x)-\frac {1}{3} \text {Subst}\left (\int \frac {-3 a+b-2 b x^2}{x^2 \left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\cot (x)\right )\\ &=-\frac {(3 a-b) \sqrt {a+b \cot ^2(x)} \tan (x)}{3 a}+\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x)+\frac {\text {Subst}\left (\int -\frac {3 a (a-b)}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\cot (x)\right )}{3 a}\\ &=-\frac {(3 a-b) \sqrt {a+b \cot ^2(x)} \tan (x)}{3 a}+\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x)+(-a+b) \text {Subst}\left (\int \frac {1}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\cot (x)\right )\\ &=-\frac {(3 a-b) \sqrt {a+b \cot ^2(x)} \tan (x)}{3 a}+\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x)+(-a+b) \text {Subst}\left (\int \frac {1}{1-(-a+b) x^2} \, dx,x,\frac {\cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )\\ &=-\sqrt {a-b} \tan ^{-1}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )-\frac {(3 a-b) \sqrt {a+b \cot ^2(x)} \tan (x)}{3 a}+\frac {1}{3} \sqrt {a+b \cot ^2(x)} \tan ^3(x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
time = 1.68, size = 174, normalized size = 2.05 \begin {gather*} \frac {1}{3} \sqrt {a+b \cot ^2(x)} \left (1+\frac {b \cot ^2(x)}{a}\right ) \sin ^2(x) \left (-\frac {4 (a-b) \cos ^2(x) \left (a+b \cot ^2(x)\right ) \, _2F_1\left (2,2;\frac {3}{2};\frac {(a-b) \cos ^2(x)}{a}\right )}{a^2}+\frac {\left (a-2 b \cot ^2(x)\right ) \csc ^2(x) \left (\text {ArcSin}\left (\sqrt {\frac {(a-b) \cos ^2(x)}{a}}\right ) \sqrt {\frac {(a-b) \cos ^2(x)}{a}}+\sqrt {\frac {b \cos ^2(x)}{a}+\sin ^2(x)}\right )}{\left (a+b \cot ^2(x)\right ) \sqrt {\frac {b \cos ^2(x)}{a}+\sin ^2(x)}}\right ) \tan ^3(x) \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[Sqrt[a + b*Cot[x]^2]*Tan[x]^4,x]

[Out]

(Sqrt[a + b*Cot[x]^2]*(1 + (b*Cot[x]^2)/a)*Sin[x]^2*((-4*(a - b)*Cos[x]^2*(a + b*Cot[x]^2)*Hypergeometric2F1[2
, 2, 3/2, ((a - b)*Cos[x]^2)/a])/a^2 + ((a - 2*b*Cot[x]^2)*Csc[x]^2*(ArcSin[Sqrt[((a - b)*Cos[x]^2)/a]]*Sqrt[(
(a - b)*Cos[x]^2)/a] + Sqrt[(b*Cos[x]^2)/a + Sin[x]^2]))/((a + b*Cot[x]^2)*Sqrt[(b*Cos[x]^2)/a + Sin[x]^2]))*T
an[x]^3)/3

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(950\) vs. \(2(71)=142\).
time = 0.64, size = 951, normalized size = 11.19

method result size
default \(\text {Expression too large to display}\) \(951\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*cot(x)^2)^(1/2)*tan(x)^4,x,method=_RETURNVERBOSE)

[Out]

-1/6*(-1+cos(x))*(3*cos(x)^3*ln(4*cos(x)*(-a+b)^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)-4*a*cos(
x)+4*b*cos(x)+4*(-a+b)^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2))*b^(3/2)*a+cos(x)^3*(-(cos(x)^2*a
-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*(-a+b)^(1/2)*b^(3/2)+3*cos(x)^3*ln(-4*(-1+cos(x))*(cos(x)*(-(cos(x)^2*a-b*c
os(x)^2-a)/(cos(x)+1)^2)^(1/2)*b^(1/2)+a*cos(x)-b*cos(x)+(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*b^(1/
2)+a)/sin(x)^2/b^(1/2))*(-a+b)^(1/2)*a^2-3*cos(x)^3*ln(-4*(-1+cos(x))*(cos(x)*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos
(x)+1)^2)^(1/2)*b^(1/2)+a*cos(x)-b*cos(x)+(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*b^(1/2)+a)/sin(x)^2/
b^(1/2))*(-a+b)^(1/2)*a*b-3*cos(x)^3*ln(4*cos(x)*(-a+b)^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)-
4*a*cos(x)+4*b*cos(x)+4*(-a+b)^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2))*b^(1/2)*a^2-4*cos(x)^3*(
-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*(-a+b)^(1/2)*b^(1/2)*a-3*cos(x)^3*ln(-2*(-1+cos(x))*(cos(x)*(-(
cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*b^(1/2)+a*cos(x)-b*cos(x)+(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^
2)^(1/2)*b^(1/2)+a)/sin(x)^2/b^(1/2))*(-a+b)^(1/2)*a^2+3*cos(x)^3*ln(-2*(-1+cos(x))*(cos(x)*(-(cos(x)^2*a-b*co
s(x)^2-a)/(cos(x)+1)^2)^(1/2)*b^(1/2)+a*cos(x)-b*cos(x)+(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*b^(1/2
)+a)/sin(x)^2/b^(1/2))*(-a+b)^(1/2)*a*b+cos(x)^2*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*(-a+b)^(1/2)*
b^(3/2)-4*cos(x)^2*(-(cos(x)^2*a-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*(-a+b)^(1/2)*b^(1/2)*a+cos(x)*(-(cos(x)^2*a
-b*cos(x)^2-a)/(cos(x)+1)^2)^(1/2)*(-a+b)^(1/2)*b^(1/2)*a+(-a+b)^(1/2)*b^(1/2)*(-(cos(x)^2*a-b*cos(x)^2-a)/(co
s(x)+1)^2)^(1/2)*a)*((cos(x)^2*a-b*cos(x)^2-a)/(cos(x)^2-1))^(1/2)/cos(x)^3/sin(x)/(-(cos(x)^2*a-b*cos(x)^2-a)
/(cos(x)+1)^2)^(1/2)*4^(1/2)/(-a+b)^(1/2)/a/b^(1/2)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(x)^2)^(1/2)*tan(x)^4,x, algorithm="maxima")

[Out]

integrate(sqrt(b*cot(x)^2 + a)*tan(x)^4, x)

________________________________________________________________________________________

Fricas [A]
time = 2.79, size = 239, normalized size = 2.81 \begin {gather*} \left [\frac {3 \, a \sqrt {-a + b} \log \left (-\frac {a^{2} \tan \left (x\right )^{4} - 2 \, {\left (3 \, a^{2} - 4 \, a b\right )} \tan \left (x\right )^{2} + a^{2} - 8 \, a b + 8 \, b^{2} + 4 \, {\left (a \tan \left (x\right )^{3} - {\left (a - 2 \, b\right )} \tan \left (x\right )\right )} \sqrt {-a + b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{\tan \left (x\right )^{4} + 2 \, \tan \left (x\right )^{2} + 1}\right ) + 4 \, {\left (a \tan \left (x\right )^{3} - {\left (3 \, a - b\right )} \tan \left (x\right )\right )} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{12 \, a}, -\frac {3 \, \sqrt {a - b} a \arctan \left (\frac {2 \, \sqrt {a - b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )}{a \tan \left (x\right )^{2} - a + 2 \, b}\right ) - 2 \, {\left (a \tan \left (x\right )^{3} - {\left (3 \, a - b\right )} \tan \left (x\right )\right )} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{6 \, a}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(x)^2)^(1/2)*tan(x)^4,x, algorithm="fricas")

[Out]

[1/12*(3*a*sqrt(-a + b)*log(-(a^2*tan(x)^4 - 2*(3*a^2 - 4*a*b)*tan(x)^2 + a^2 - 8*a*b + 8*b^2 + 4*(a*tan(x)^3
- (a - 2*b)*tan(x))*sqrt(-a + b)*sqrt((a*tan(x)^2 + b)/tan(x)^2))/(tan(x)^4 + 2*tan(x)^2 + 1)) + 4*(a*tan(x)^3
 - (3*a - b)*tan(x))*sqrt((a*tan(x)^2 + b)/tan(x)^2))/a, -1/6*(3*sqrt(a - b)*a*arctan(2*sqrt(a - b)*sqrt((a*ta
n(x)^2 + b)/tan(x)^2)*tan(x)/(a*tan(x)^2 - a + 2*b)) - 2*(a*tan(x)^3 - (3*a - b)*tan(x))*sqrt((a*tan(x)^2 + b)
/tan(x)^2))/a]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a + b \cot ^{2}{\left (x \right )}} \tan ^{4}{\left (x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(x)**2)**(1/2)*tan(x)**4,x)

[Out]

Integral(sqrt(a + b*cot(x)**2)*tan(x)**4, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 476 vs. \(2 (71) = 142\).
time = 0.49, size = 476, normalized size = 5.60 \begin {gather*} -\frac {1}{6} \, {\left (3 \, \sqrt {-a + b} \log \left ({\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2}\right ) - \frac {4 \, {\left (3 \, {\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{4} {\left (2 \, a - b\right )} \sqrt {-a + b} - 6 \, {\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2} a^{2} \sqrt {-a + b} + {\left (4 \, a^{3} - a^{2} b\right )} \sqrt {-a + b}\right )}}{{\left ({\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2} - a\right )}^{3}}\right )} \mathrm {sgn}\left (\sin \left (x\right )\right ) + \frac {{\left (3 \, a^{2} \sqrt {-a + b} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) - 9 \, a^{2} \sqrt {b} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) - 15 \, a \sqrt {-a + b} b \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) + 21 \, a b^{\frac {3}{2}} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) + 12 \, \sqrt {-a + b} b^{2} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) - 12 \, b^{\frac {5}{2}} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) + 8 \, a^{2} \sqrt {-a + b} - 18 \, a^{2} \sqrt {b} - 24 \, a \sqrt {-a + b} b + 30 \, a b^{\frac {3}{2}} + 12 \, \sqrt {-a + b} b^{2} - 12 \, b^{\frac {5}{2}}\right )} \mathrm {sgn}\left (\sin \left (x\right )\right )}{6 \, {\left (a^{2} + 3 \, a \sqrt {-a + b} \sqrt {b} - 5 \, a b - 4 \, \sqrt {-a + b} b^{\frac {3}{2}} + 4 \, b^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cot(x)^2)^(1/2)*tan(x)^4,x, algorithm="giac")

[Out]

-1/6*(3*sqrt(-a + b)*log((sqrt(-a + b)*cos(x) - sqrt(-a*cos(x)^2 + b*cos(x)^2 + a))^2) - 4*(3*(sqrt(-a + b)*co
s(x) - sqrt(-a*cos(x)^2 + b*cos(x)^2 + a))^4*(2*a - b)*sqrt(-a + b) - 6*(sqrt(-a + b)*cos(x) - sqrt(-a*cos(x)^
2 + b*cos(x)^2 + a))^2*a^2*sqrt(-a + b) + (4*a^3 - a^2*b)*sqrt(-a + b))/((sqrt(-a + b)*cos(x) - sqrt(-a*cos(x)
^2 + b*cos(x)^2 + a))^2 - a)^3)*sgn(sin(x)) + 1/6*(3*a^2*sqrt(-a + b)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) -
 9*a^2*sqrt(b)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) - 15*a*sqrt(-a + b)*b*log(-a - 2*sqrt(-a + b)*sqrt(b) +
2*b) + 21*a*b^(3/2)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) + 12*sqrt(-a + b)*b^2*log(-a - 2*sqrt(-a + b)*sqrt(
b) + 2*b) - 12*b^(5/2)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) + 8*a^2*sqrt(-a + b) - 18*a^2*sqrt(b) - 24*a*sqr
t(-a + b)*b + 30*a*b^(3/2) + 12*sqrt(-a + b)*b^2 - 12*b^(5/2))*sgn(sin(x))/(a^2 + 3*a*sqrt(-a + b)*sqrt(b) - 5
*a*b - 4*sqrt(-a + b)*b^(3/2) + 4*b^2)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\mathrm {tan}\left (x\right )}^4\,\sqrt {b\,{\mathrm {cot}\left (x\right )}^2+a} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)^4*(a + b*cot(x)^2)^(1/2),x)

[Out]

int(tan(x)^4*(a + b*cot(x)^2)^(1/2), x)

________________________________________________________________________________________